  <template>
  <div class="app">
      <el-table :data="tableData" style="width: 100%">
          <el-table-column prop="id" label="编号" width="180"></el-table-column>
          <el-table-column prop="date" label="日期" width="180"></el-table-column>
          <el-table-column prop="name" label="姓名" width="180"></el-table-column>
          <el-table-column prop="address" label="地址"></el-table-column>
      </el-table>
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="currentPage"
        :page-sizes="[10, 20, 30, 40]"
        :page-size="10"
        layout="total, sizes, prev, pager, next, jumper"
        :total="40">
      </el-pagination>
  </div>

  </template>
  <script>
    export default {
      data() {
        return {
          tableData: [{
            id:1,
            date: '2016-05-02',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1518 弄'
          }, {
            id:2,
            date: '2016-05-04',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1517 弄'
          }, {
            id:3,
            date: '2016-05-01',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1519 弄'
          }, {
            id:4,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1516 弄'
          }, {
            id:5,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1520 弄'
          }, {
            id:6,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1521 弄'
          }, {
            id:7,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1522 弄'
          }, {
            id:8,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1523 弄'
          }, {
            id:9,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1524 弄'
          }, {
            id:10,
            date: '2016-05-03',
            name: '王小虎',
            address: '上海市普陀区金沙江路 1524 弄'
          }],
          // 默认显示第一条
          currentPage:1
        }
      },
      methods: {
          handleSizeChange(val) {
            console.log(`每页 ${val} 条`);
          },
          handleCurrentChange(val) {
            console.log(`当前页: ${val}`);
          }
       },
    }

    
  </script>


